package com.fyk.utils;

import com.fyk.entity.Book;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author qazws
 * @Date 2022/8/19 13:48
 * @Version 1.0
 */
public class PageUtils {

    public static Map<String,Object> getPage(List list){
        PageInfo pageInfo = new PageInfo<>(list);
        Map<String,Object> map = new HashMap<>();
        map.put("totalPage",pageInfo.getPages());
        map.put("list",pageInfo.getList());
        map.put("total",pageInfo.getTotal());//总条数
        return map;
    }
}
